const order_stg_cdh = "# -*- coding: utf-8 -*-\n" +
    "\n" +
    "from stcquant.api.strategy_mode import strategy_mode\n" +
    "\n" +
    "\n" +
    "class strategy(strategy_mode):\n" +
    "\n" +
    "    def init(self):\n" +
    "        self.quote_count = 0\n" +
    "        self.symbol = '200205.IB'\n" +
    "        self.gw = 'cdh'\n" +
    "        self.tick = 0\n" +
    "        self.ask_spread = 0.0025\n" +
    "        self.bid_spread = 0.005\n" +
    "\n" +
    "        self.subscribe([self.symbol], self.gw, ['tick'])\n" +
    "\n" +
    "    # 行情回报\n" +
    "    # --------------------------------------------------------------------------\n" +
    "    def on_tick(self, data):\n" +
    "        bid_ytm = data['bid_ytm'] + self.bid_spread\n" +
    "        self.set_indicator('bid_ytm', data['bid_ytm'], '最新bid价格')\n" +
    "        self.set_indicator('ofr_ytm', data['ofr_ytm'], '最新ofr价格')\n" +
    "        # 每收到50笔行情，完成一次成交\n" +
    "        if self.tick % 50 == 0:\n" +
    "            self.order = self.send_order('1', '2', '', '', self.symbol, 2000, bid_ytm)\n" +
    "        # if self.tick == 0:\n" +
    "        # self.tick += 1\n" +
    "        # print('11111',self.tick)\n" +
    "        # if self.tick == 10 :\n" +
    "        # self.order = self.send_order('1','2','','',self.symbol, 2000, 3.61)\n" +
    "        # self.tick = 0\n" +
    "\n" +
    "    # 报单回报\n" +
    "    # --------------------------------------------------------------------------\n" +
    "    def on_order(self, data):\n" +
    "        self.set_indicator('order_id', data['order_id'], '报单编号')\n" +
    "        self.set_indicator('order_status', data['order_status'], '报单状态')\n" +
    "        self.set_indicator('status_msg', data['status_msg'], '报单状态描述')\n" +
    "        self.set_indicator('update_time', data['update_time'], '报单更新时间')\n" +
    "        self.set_indicator('insert_time', data['insert_time'], '报单写入时间')\n" +
    "\n" +
    "    # 成交回报\n" +
    "    # --------------------------------------------------------------------------\n" +
    "    def on_trade(self, data):\n" +
    "        # print('成交回报:\\n',data)\n" +
    "        pass\n" +
    "\n" +
    "    # 持仓回报\n" +
    "    # --------------------------------------------------------------------------\n" +
    "    def on_position(self, data):\n" +
    "        # print('持仓回报:\\n',data)\n" +
    "        pass\n" +
    "\n" +
    "    # 参数回报\n" +
    "    # --------------------------------------------------------------------------\n" +
    "    def on_param(self, data):\n" +
    "        # print('参数回报:\\n',data)\n" +
    "        pass\n" +
    "\n" +
    "    # 定时器\n" +
    "    # def hello(self):\n" +
    "    #     self.set_indicator('1','1','1')\n" +
    "\n" +
    "\n" +
    "if __name__ == '__main__':\n" +
    "    # 如何开始运行策略\n" +
    "    main = strategy()\n"
